<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    <link rel="stylesheet" href="/css/bootstrap.min.css">
</head>
<body>
<!--导航条-->
<div th:fragment="nav">
    <nav class="navbar navbar-expand-lg navbar-light  sticky-top" style = "background: #cad5e1c2">
        <div class="container">
            <a href="/index" class="navbar-brand">
                <!--                <img src="/img/slider/1.jpg" alt="" width="30" height="30" class="d-inline-block align-top">-->
                宠物领养中心
            </a>
            <button class="navbar-toggler" data-toggle="collapse" data-target="#navbarNav">
                <span class="navbar-toggler-icon"></span>
            </button>

            <div class="collapse navbar-collapse" id="navbarNav">
                <ul class="navbar-nav mr-auto">
                    <li class="nav-item">
                        <a href="/index" class="nav-link active">首页</a>
                    </li>
<!--                    <li class="nav-item">-->
<!--                        <a href="#" class="nav-link">宠物知识</a>-->
<!--                    </li>-->
                    <li class="nav-item">
                        <a href="/show" class="nav-link">领养宠物</a>
                    </li>


                </ul>
                <ul class="navbar-nav mr-5">
                    <li class="nav-item dropdown"   th:if="${session.Name != null}">
                        <a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown">
                            <span  th:text="${session.Name}"></span>
                        </a>
                        <div class="dropdown-menu">
                            <a href="/info" class="dropdown-item">个人中心</a>
                            <a href="/logout" class="dropdown-item">退出登录</a>
                        </div>
                    </li>
                    <li class="nav-item" th:if="${session.Name == null}">
                        <a href="/login" class="nav-link">登录</a>
                    </li>
                </ul>
                <form action="/search" method="get" class="form-inline" style="position: absolute;left: 580px;">
                    <input class="form-control mr-sm-2" type="search" placeholder="请输入关键字" aria-label="Search" name="searchName">
                    <button class="btn btn-outline-success my-2 my-sm-0" type="submit">搜索</button>
                </form>

            </div>
        </div>
    </nav>

</div>
<script src="/js/jquery.min.js"></script>
<script src="/js/bootstrap.bundle.min.js"></script>
</body>
</html>
